package com.sh.data.engine.domain.common.model.domain;

import com.alibaba.fastjson.annotation.JSONField;
import gudusoft.gsqlparser.dlineage.dataflow.model.json.Coordinate;
import gudusoft.gsqlparser.dlineage.metadata.Transform;

import java.util.Arrays;

public class RelationshipElement {
    @JSONField(ordinal = 1)
    private String id;

    @JSONField(ordinal = 2)
    private String name;

    @JSONField(ordinal = 3)
    private String column;

    @JSONField(ordinal = 4)
    private String columnType;

    @JSONField(ordinal = 5)
    private String sourceId;

    @JSONField(ordinal = 6)
    private String sourceName;

    @JSONField(ordinal = 7)
    private Transform[] transforms;

    @JSONField(ordinal = 8)
    private String parentId;

    @JSONField(ordinal = 9)
    private String parentName;

    @JSONField(ordinal = 10)
    private String clauseType;

    @JSONField(ordinal = 11)
    private String function;

    @JSONField(ordinal = 12)
    private String type;

    @JSONField(ordinal = 13)
    private Coordinate[] coordinates;

    public void setId(String id) {
        this.id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setColumn(String column) {
        this.column = column;
    }

    public void setColumnType(String columnType) {
        this.columnType = columnType;
    }

    public void setSourceId(String sourceId) {
        this.sourceId = sourceId;
    }

    public void setSourceName(String sourceName) {
        this.sourceName = sourceName;
    }

    public void setTransforms(Transform[] transforms) {
        this.transforms = transforms;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public void setClauseType(String clauseType) {
        this.clauseType = clauseType;
    }

    public void setFunction(String function) {
        this.function = function;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setCoordinates(Coordinate[] coordinates) {
        this.coordinates = coordinates;
    }

    public boolean equals(Object o) {
        if (o == this)
            return true;
        if (!(o instanceof RelationshipElement))
            return false;
        RelationshipElement other = (RelationshipElement) o;
        if (!other.canEqual(this))
            return false;
        Object this$id = getId(), other$id = other.getId();
        if ((this$id == null) ? (other$id != null) : !this$id.equals(other$id))
            return false;
        Object this$name = getName(), other$name = other.getName();
        if ((this$name == null) ? (other$name != null) : !this$name.equals(other$name))
            return false;
        Object this$column = getColumn(), other$column = other.getColumn();
        if ((this$column == null) ? (other$column != null) : !this$column.equals(other$column))
            return false;
        Object this$columnType = getColumnType(), other$columnType = other.getColumnType();
        if ((this$columnType == null) ? (other$columnType != null) : !this$columnType.equals(other$columnType))
            return false;
        Object this$sourceId = getSourceId(), other$sourceId = other.getSourceId();
        if ((this$sourceId == null) ? (other$sourceId != null) : !this$sourceId.equals(other$sourceId))
            return false;
        Object this$sourceName = getSourceName(), other$sourceName = other.getSourceName();
        if ((this$sourceName == null) ? (other$sourceName != null) : !this$sourceName.equals(other$sourceName))
            return false;
        if (!Arrays.deepEquals((Object[]) getTransforms(), (Object[]) other.getTransforms()))
            return false;
        Object this$parentId = getParentId(), other$parentId = other.getParentId();
        if ((this$parentId == null) ? (other$parentId != null) : !this$parentId.equals(other$parentId))
            return false;
        Object this$parentName = getParentName(), other$parentName = other.getParentName();
        if ((this$parentName == null) ? (other$parentName != null) : !this$parentName.equals(other$parentName))
            return false;
        Object this$clauseType = getClauseType(), other$clauseType = other.getClauseType();
        if ((this$clauseType == null) ? (other$clauseType != null) : !this$clauseType.equals(other$clauseType))
            return false;
        Object this$function = getFunction(), other$function = other.getFunction();
        if ((this$function == null) ? (other$function != null) : !this$function.equals(other$function))
            return false;
        Object this$type = getType(), other$type = other.getType();
        return ((this$type == null) ? (other$type != null) : !this$type.equals(other$type)) ? false : (!!Arrays.deepEquals((Object[]) getCoordinates(), (Object[]) other.getCoordinates()));
    }

    protected boolean canEqual(Object other) {
        return other instanceof RelationshipElement;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        Object $id = getId();
        result = result * 59 + (($id == null) ? 43 : $id.hashCode());
        Object $name = getName();
        result = result * 59 + (($name == null) ? 43 : $name.hashCode());
        Object $column = getColumn();
        result = result * 59 + (($column == null) ? 43 : $column.hashCode());
        Object $columnType = getColumnType();
        result = result * 59 + (($columnType == null) ? 43 : $columnType.hashCode());
        Object $sourceId = getSourceId();
        result = result * 59 + (($sourceId == null) ? 43 : $sourceId.hashCode());
        Object $sourceName = getSourceName();
        result = result * 59 + (($sourceName == null) ? 43 : $sourceName.hashCode());
        result = result * 59 + Arrays.deepHashCode((Object[]) getTransforms());
        Object $parentId = getParentId();
        result = result * 59 + (($parentId == null) ? 43 : $parentId.hashCode());
        Object $parentName = getParentName();
        result = result * 59 + (($parentName == null) ? 43 : $parentName.hashCode());
        Object $clauseType = getClauseType();
        result = result * 59 + (($clauseType == null) ? 43 : $clauseType.hashCode());
        Object $function = getFunction();
        result = result * 59 + (($function == null) ? 43 : $function.hashCode());
        Object $type = getType();
        result = result * 59 + (($type == null) ? 43 : $type.hashCode());
        return result * 59 + Arrays.deepHashCode((Object[]) getCoordinates());
    }

    public String toString() {
        return "RelationshipElement(id=" + getId() + ", name=" + getName() + ", column=" + getColumn() + ", columnType=" + getColumnType() + ", sourceId=" + getSourceId() + ", sourceName=" + getSourceName() + ", transforms=" + Arrays.deepToString((Object[]) getTransforms()) + ", parentId=" + getParentId() + ", parentName=" + getParentName() + ", clauseType=" + getClauseType() + ", function=" + getFunction() + ", type=" + getType() + ", coordinates=" + Arrays.deepToString((Object[]) getCoordinates()) + ")";
    }

    public String getId() {
        return this.id;
    }

    public String getName() {
        return this.name;
    }

    public String getColumn() {
        return this.column;
    }

    public String getColumnType() {
        return this.columnType;
    }

    public String getSourceId() {
        return this.sourceId;
    }

    public String getSourceName() {
        return this.sourceName;
    }

    public Transform[] getTransforms() {
        return this.transforms;
    }

    public String getParentId() {
        return this.parentId;
    }

    public String getParentName() {
        return this.parentName;
    }

    public String getClauseType() {
        return this.clauseType;
    }

    public String getFunction() {
        return this.function;
    }

    public String getType() {
        return this.type;
    }

    public Coordinate[] getCoordinates() {
        return this.coordinates;
    }
}